{% block sw_settings_cart_index %}
<sw-page class="sw-settings-cart">

    {% block sw_settings_cart_search_bar %}
    <template #search-bar>
        <sw-search-bar />
    </template>
    {% endblock %}

    {% block sw_settings_cart_smart_bar_header %}
    <template #smart-bar-header>
        {% block sw_settings_cart_smart_bar_header_title %}
        <h2>
            {% block sw_settings_cart_smart_bar_header_title_text %}
            {{ $tc('sw-settings.index.title') }}
            <mt-icon
                name="regular-chevron-right-xs"
                size="12px"
            />
            {{ $tc('sw-settings-cart.general.textHeadline') }}
            {% endblock %}

            {% block sw_settings_cart_smart_bar_header_amount %}
            <span
                v-if="false"
                class="sw-page__smart-bar-amount"
            >
                ({{ total }})
            </span>
            {% endblock %}
        </h2>
        {% endblock %}
    </template>
    {% endblock %}

    {% block sw_settings_cart_smart_bar_actions %}
    <template #smart-bar-actions>
        {% block sw_settings_cart_actions_save %}
        <sw-button-process
            class="sw-settings-cart__save-action"
            :is-loading="isLoading"
            :process-success="isSaveSuccessful"
            :disabled="isLoading"
            variant="primary"
            @update:process-success="saveFinish"
            @click="onSave"
        >
            {{ $tc('sw-settings-cart.general.buttonSave') }}
        </sw-button-process>
        {% endblock %}
    </template>
    {% endblock %}

    {% block sw_settings_cart_content %}
    <template #content>
        <sw-card-view>
            <template v-if="isLoading">
                <sw-skeleton />
                <sw-skeleton />
            </template>

            {# v-show is used here as underlying components influence the loading state and v-if would destroy this behaviour #}
            <sw-system-config
                v-show="!isLoading"
                ref="systemConfig"
                sales-channel-switchable
                domain="core.cart"
                @loading-changed="onLoadingChanged"
            />

            <sw-extension-component-section
                v-show="!isLoading"
                position-identifier="sw-settings-cart__after-content"
            />
        </sw-card-view>
    </template>
    {% endblock %}
</sw-page>
{% endblock %}
